package com.hs.server.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hs.server.domain.ShResourcexx;
import com.hs.server.exception.GlobalException;
import com.hs.server.mapper.ShResourcexxMapper;
import com.hs.server.service.ShResourcexxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description
 * @Author: chenjiarui
 * @Date: 2021-07-08 18:23
 */
@Service
public class ShResourcexxServiceImpl extends ServiceImpl<ShResourcexxMapper, ShResourcexx> implements ShResourcexxService {
    @Autowired
    ShResourcexxMapper shResourcexxMapper;


    @Override
    public ShResourcexx getOneLeisureResourcexx() {
        return shResourcexxMapper.getOneLeisureResourcexx();
    }

    @Override
    public synchronized void updateResourcexx(ShResourcexx shResourcexx) {
        if(shResourcexxMapper.updateById(shResourcexx) != 1) {
            throw new GlobalException("修改服务器信息失败");
        }
    }

    @Override
    public int getShzcs(String fwqbh) {
        return shResourcexxMapper.getShzcs(fwqbh);
    }

    @Override
    public int getclcs(String fwqbh) {
        return shResourcexxMapper.getclcs(fwqbh);
    }

    @Override
    public int updateSfkx() {
        return shResourcexxMapper.updateSfkx();
    }

    @Override
    public int resetResource() {
        return shResourcexxMapper.resetResource();
    }
}
